package com.atguigu.gmall.user.controller;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.user.service.UserAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * projectName: gmall
 *
 * @author: 陈鹏
 * time: 2022/10/6 21:18 星期四
 * description: 用户收货地址的控制层
 */
@RestController
@RequestMapping(value = "/api/user/address")
public class UserAddressController {

    @Autowired
    private UserAddressService userAddressService;

    /**
     * 根据用户Id查询用户收获地址
     * @return
     */
    @GetMapping(value = "/getUserAddress")
    public Result getUserAddress(){
        //查询收货地址返回
        return Result.ok(userAddressService.getUserAddressList());
    }
}
